/* eslint-disable */
import echartsOneOption from './echartsOneOption'
import echartsTwoOption from './echartsTwoOption'
import echartsThreeOption from './echartsThreeOption'
import echartsFourOption from './echartsFourOption'
import { getNoticeNum ,getMessage1,getMessage2} from '@/api/homepage'

export default {
  data() {
    return {
      mode:"消息提醒",
      activeNames:"",
      noticenum:{
        data: {
          message: '',
          todo: ''
        }
      },
      message1:{
        data:{
          name:'',
          them: '',
          content:'',
          date:'',
          status:'',
        }
      },
      message2:{
        name:null,
        them: null,
        content:{},
        date:null,
        status:null,
      }
    }
  },
  mounted() {
    
    this.drawChart()
    this.fetchNoticenum()
    this.fetchMessage1()
    this.fetchMessage2()
  },
  methods: {
    

    // 绘制图表
    drawChart(){
      
      // 图表3
      let echartsThree = this.$echarts.init(document.getElementById('echartsThree'))
      echartsThree.setOption(echartsThreeOption())

      // 图表4
      let echartsFour = this.$echarts.init(document.getElementById('echartsFour'), 'light')
      echartsFour.setOption(echartsFourOption())
    },
    //获取通知数
    fetchNoticenum(){
        this.listLoading = true
        getNoticeNum().then(response => {
            this.noticenum = response.data
            this.listLoading = false
      })
    },
    //获取“消息提醒”
    fetchMessage1(){
      this.listLoading = true
      getMessage1().then(response => {
        
          this.message1 = response.data
          this.listLoading = false
      })
    },
    //获取“待办消息”
    fetchMessage2(){
      this.listLoading = true
      getMessage2().then(response => {
          this. message2= response.data
          this.listLoading = false
      })
    },
    
  }
}
